<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@page import ="com.hs.hip.bean.init.UserAuthorityInfo" %>
<%@ page import="com.hs.hip.org.menu.*" %>
<%@ page import="com.hs.hip.common.*" %>
<%@ page import="com.hs.hip.org.api.OrgConstant" %>
<%@ page import="com.hs.hip.proxy.init.model.UserApplicationCount" %>
<%@ page import="com.hs.hip.proxy.init.LoginProxy" %>
<%@ page import="com.hs.hip.proxy.org.mng.model.AdditionalOfficerInfo" %>
<%@ page import="com.hs.hip.proxy.org.mng.UserProxy" %>
<%@ page import="com.hs.hip.proxy.org.login.LoginParseProxy" %>
<%@ page extends="com.hs.hip.servlet.HIJspPage"  %>
<%!{initHI("SLET=org.init.StartMenu.java&MET=MENU");}%>
<%@ include file ="/jsp/charHeader.jsp" %>
<%@ include file ="/jsp/Session.jsp" %>
<%@ include file ="/jsp/_inc/CacheControl_long.jsp" %>
<%@ include file="/jsp/main/inc/common.jsp" %>
<%
	response.setContentType("text/html;charset=utf-8");
	UserAuthorityInfo uai = (UserAuthorityInfo) session.getAttribute("UA");
	CommunityConf conf = CommunityConf.getCommunityConf();
	boolean bGPRelate = conf.bGPRelate;
%>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-compatible" content="IE=EmulateIE8">
<title><c:out value="${INI_SZBROWSERTITLE}" /></title>
<link rel="stylesheet" type="text/css" href="/css/main/basic.css" media="screen">
<link rel="stylesheet" type="text/css" href="/css/main/layer_pop.css" media="screen">
<!-- organization -->
<script type="text/javascript">
	var bGPRelate = <%=bGPRelate%>;
	var default_list_count = <c:out value="${default_duty_list_count}"/>;
	var min_ago = "<fmt:message bundle='${common}' key='min_ago' />";
	var hour_ago = "<fmt:message bundle='${common}' key='hour_ago' />";
	var day_ago = "<fmt:message bundle='${common}' key='day_ago' />";
	var month_ago = "<fmt:message bundle='${common}' key='month_ago' />";
	var year_ago = "<fmt:message bundle='${common}' key='year_ago' />";
	var body_empty_list = "<fmt:message bundle='${common}' key='body_empty_list' />";

	var APP_Z0000000000000000001 = "<fmt:message bundle='${common}' key='APP_Z0000000000000000001' />";
	var APP_Z0000000000000000002 = "<fmt:message bundle='${common}' key='APP_Z0000000000000000002' />";
	var APP_Z0000000000000000003 = "<fmt:message bundle='${common}' key='APP_Z0000000000000000003' />";
	var APP_Z0000000000000000004 = "<fmt:message bundle='${common}' key='APP_Z0000000000000000004' />";
	var view_more = "<fmt:message bundle='${common}' key='body_view_more' />";
	var count_itme = "<fmt:message bundle='${common}' key='Item' />"
	
	// Groupware value
	var GPSaveDocDeptID = '<%=uai.szDeptIDWithDocBox%>';
	var GPSaveDocDeptName = '<%=uai.szDeptNameWithDocBox%>';
	var UserDeptID = '<c:out value="${UA.deptID}"/>';
	var GPIP = '<c:out value="${INI_SZGPIP}"/>';
	var GPPORT = '<c:out value="${INI_NGPPORT}"/>';
	var GPURL = '<c:out value="${INI_SZGPURL}"/>';
	var isDocAdmin = '<c:out value="${UA.munAdmin}"/>';
	var isSimsaJa = '<c:out value="${UA.simsaAdmin}"/>';
	var isOrgAdmin = '<c:out value="${UA.orgSancAdmin}"/>';
	var isSusinAdmin = '<c:out value="${UA.susinAdmin}"/>';
	var isManager = '<c:out value="${UA.manager}"/>';
	var UserID = parseInt('<c:out value="${UA.userID}"/>',10);
	var BWURL = '<c:out value="${INI_SZWEBSERVER_URL}"/>';
	var szKEY = '<c:out value="${UA.key}"/>';
	var emp_code = '<c:out value="${UA.empCode}"/>';
	var user_id	= '<c:out value="${UA.userID}"/>';
	var community_id = '<%=uai.szCommunityID%>';
	var preLinkedAnchor = null;
	var use_cop = null;
	var use_cloud = false;
	<c:choose>
		<c:when test="${INI_BUSECOP eq '1'}">
	var use_cop = true;
		</c:when>
		<c:otherwise>
	var use_cop = false;
		</c:otherwise>
	</c:choose>
	<c:if test="${INI_BUSECLOUD eq '1'}">
		use_cloud = true;
	</c:if>
	var GWLANG = "<c:out value="${cookie.GWLANG.value}" />";
	
	

	function doMenuLoad2(doctype) {
		switch_main('SANC')

		var isdocadmin = "true";
		var issimsaja = "true";
		var usu = "<c:out value="${UA.userID}"/>";
		var menumask = 1;
		var confhtml = '';
		var onmenu = '';

		if (isdocadmin == 'true')
			menumask += 2;
		if (issimsaja == 'true')
			menumask += 4;
		
		switch (doctype) {
			case 'APPRWAIT':
				url = '/bms/act_call_fldr.jsp?APPLID=2010';
				break;
			case 'PUBLICWAIT':
				url = '/bms/act_call_fldr.jsp?APPLID=2010';
				break;
			case 'EXAMWAIT':
				url = '/bms/act_call_fldr.jsp?APPLID=4030';
				break;
			case 'EXAMPROC':
				url = '/bms/act_call_fldr.jsp?APPLID=4010';
				break;
			case 'EXAMPROC2':
				url = '/bms/act_call_fldr.jsp?APPLID=4040';
				break;
			case 'RECVWAIT':
				url = '/bms/act_call_fldr.jsp?APPLID=5010';
				break;
			case 'RECVING':
				url = '/bms/act_call_fldr.jsp?APPLID=5020';
				break;
			case 'REPLYWAITING':
				url = '/bms/act_call_fldr.jsp?APPLID=5070';
				break;
			default:
				url = '/bms/act_call_fldr.jsp?APPLID=2010';
				break;
		}
		
		url += '&USU=' + usu;

		if (isdocadmin == 'true') {
			url += '&$DOCADMIN$=1';
		} else {
			url += '&$DOCADMIN$=0';
		}
		url += '&K=' + szKEY;
		url += '&DEPTID=' + GPSaveDocDeptID;
		url += '&USERDEPTID=' + UserDeptID;
		//alert(url)
		this.location = getRefreshURL(url);
	}
</script>

<script type="text/javascript" src="/js/lib/jQuery/jquery-1.7.2.js"></script>
<script type="text/javascript" src="/js/main/menu.js"></script>
<script language="javascript" src="/bms/js/cz/cb/viw/commutil.js"> </script>
<script language="javascript" src="/bms/js/common.js"> </script>
<script language="javascript" src="/bms/js/gpload.js"> </script>

</head>
<body>
	<!-- Handy GW 8.0 Wrapper -->
	<div id="wrap_menu">
		<!-- header -->
		<div id="header">
			<h1>
				<a href="javascript:switch_main('/jsp/main/main.jsp')"><img src="/img/main/smartoffice.png" alt="HANDY Groupware" width="200" height="57"></a>
			</h1>
			<!-- nav_bar -->
			<div class="nav_area">
				<!-- menu navigation -->

				<!-- normal user menu -->
				<ul id="normal_menu" class="menu">
					<li><a id="menu_0" href="javascript:switch_main('/wma/fld.do?acton=main&pagename=main_web&K=<c:out value="${UA.key}"/>');" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_mail' /><span class="yellow" ></span></a></li>
					<li><a id="menu_1" href="javascript:switch_main('/servlet/HIServlet?SLET=bbs.BBS.java&K=<c:out value="${UA.key}"/>');" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_board' /><span class="skyblue" ></span></a></li>
					<c:if test="${INI_BUSEDCS eq '1'}">
						<li><a id="menu_2" href="javascript:switch_main('/dcs/tm/jsp/main.jsp?K=<c:out value="${UA.key}"/>')" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_biznet' /><span class="orange" ></span></a></li>						
					</c:if>
					<li><a id="menu_3" href="javascript:gpLoad2('/cz/cb/viw/retrieveApprFrame.act','MENU_HOMS_SBOX');" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_approval' /><span class="red" ></span></a></li>
					<li><a id="menu_4" href="javascript:gpLoad2('/cz/cb/viw/retrieveDocFrame.act','MENU_HOMS_DRAFT_BOX',58);" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_cabinet' /></a></li>
					<li><a id="menu_5" href="javascript:switch_main('/hscalendar/jsp/init.jsp?method=main&K=<c:out value="${UA.key}"/>&loc=<c:out value="${cookie.GWLANG.value}"/>&userID=<c:out value="${UA.userID}"/>');" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_schedule' /></a></li>
					<li><a id="menu_6" href="javascript:switch_main('/hscalendar/jsp/init.jsp?method=main&K=<c:out value="${UA.key}"/>&loc=<c:out value="${cookie.GWLANG.value}"/>&userID=<c:out value="${UA.userID}"/>&mode=equip');" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_equipment' /></a></li>
					<li><a id="menu_7" href="javascript:switch_main('/contact/contact.do?act=main&K=<c:out value="${UA.key}"/>&loc=<c:out value="${cookie.GWLANG.value}"/>');" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_contact' /></a></li>
					<li><a id="menu_8" href="javascript:switch_main('/jsp/rsch/MainFrame.jsp?K=<c:out value="${UA.key}"/>');" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_research' /></a></li>
				<c:if test="${INI_BUSECOP eq '1'}">
					<li><a id="menu_9" href="javascript:switch_main('/hcop/portal/sso.psml?acton=SSO_IN&EMP=<c:out value="${UA.empCode}"/>&PAGE=/portal/cop_frame.psml&frameMode=main');" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu.copmain' /></a></li>
				</c:if>
				<c:if test="${INI_BUSEMEETING eq '1'}">
					<li><a id="menu_10" href="javascript:switch_main('/Meetingmanagement/meeting/index.jsp?K=<c:out value="${UA.key}"/>')" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu_meeting' /></a></li>
				</c:if>
				<c:if test="${INI_BUSECLOUD eq '1'}">
					<li><a id="menu_11" href="javascript:switch_main('/cloudfolder/main.do?K=<c:out value="${UA.key}"/>')" onclick="toggle_menu_bg(this.id)"><fmt:message bundle='${common}' key='menu.cloud' /></a></li>
				</c:if>
				<c:if test="${INI_BUSESNS eq '1'}">
					<script>var use_sns = 1;</script>
					<li><a id="menu_12" href="javascript:switch_main('/sns/memo/memo_list_so.action?mem_id=<c:out value="${UA.userID}"/>&session_id=<c:out value="${UA.key}"/>')" onclick="toggle_menu_bg(this.id)">SNS</a></li>
				</c:if>
					<!--
					<li class="menu_more" onclick="toggle_hide_memu()"></li>
					-->
				</ul>
				<!-- //normal user menu -->

				<!-- administrator menu -->
				<ul id="admin_menu" class="menu link" style="display: none;">
					<li class="menu_more" onclick="switch_menu('admin_menu')" title="<fmt:message bundle='${common}' key='menu_close' />"><span class="arr_fd"></span></li>
				<c:if test="${UA.manager or UA.orgSancAdmin}">
					<li><a id="menu_a0" onclick="toggle_menu_bg(this.id)" href="javascript:switch_main('/jsp/org/mng/OrgFrame.jsp?K=<c:out value="${UA.key}"/>')"><fmt:message bundle='${common}' key='menu.admin.organization' /></a></li>
				</c:if>
				
				<c:if test="${UA.manager or UA.deptManager or UA.orgSancAdmin or UA.formAdmin}">
					<c:if test="${EXISTSDOCFOLDER or (UA.manager or UA.deptManager)}">
						<li><a id="menu_a1" onclick="toggle_menu_bg(this.id)" href="javascript:gpLoad2('/cz/cb/viw/retrieveFormFrame.act','MENU_HOMS_SBOX')"><fmt:message bundle='${common}' key='menu.admin.apprform' /></a></li>
					</c:if>					
				</c:if>
				<c:if test="${(UA.GLAdmin or UA.munAdmin) and (INI_BIZUNITUSE eq 1)}">
					<li><a id="menu_docfile" onclick="toggle_menu_bg(this.id)" href="javascript:gpLoad2('/cz/cb/viw/retrieveDocFileFrame.act','MENU_HOMS_DRAFT_BOX',58)"><fmt:message bundle='${common}' key='menu.admin.archive' /></a></li>
				</c:if>
				
				<!--
				<c:if test="${UA.manager or UA.formAdmin}">
					<li><a href="javascript:switch_main('/jsp/form/MainFrame.jsp?K=<c:out value="${UA.key}"/>')"><fmt:message bundle='${common}' key='menu.admin.form' /></a></li>
				</c:if>
				-->

				<c:if test="${INI_BUSEBBS eq '1' and (UA.manager or UA.BBSAdmin)}">
					<li><a id="menu_a3" onclick="toggle_menu_bg(this.id)" href="javascript:switch_main('/servlet/HIServlet?SLET=bbs.BoardMngFrame.java&K=<c:out value="${UA.key}"/>')"><fmt:message bundle='${common}' key='menu.admin.bbs' /></a></li>
				</c:if>
				
				<c:if test="${UA.manager or UA.infoAdmin}">
					<li><a id="menu_a5" onclick="toggle_menu_bg(this.id)" href="javascript:switch_main('/jsp/sm/SMFrame.jsp?K=<c:out value="${UA.key}"/>')"><fmt:message bundle='${common}' key='menu.admin.system' /></a></li>
				</c:if>
					
				<c:if test="${INI_BUSECOP eq '1' and (UA.manager or UA.COPAdmin) }">
					<li><a id="menu_a6" onclick="toggle_menu_bg(this.id)" href="javascript:switch_main('/hcop/portal/sso.psml?acton=SSO_IN&EMP=<c:out value="${UA.empCode}"/>&PAGE=/portal/cop_frame.psml&frameMode=admin')"><fmt:message bundle='${common}' key='menu.admin.cop' /></a></li>
				</c:if>
				
				<c:if test="${UA.manager}">
					<li><a id="menu_a7" onclick="toggle_menu_bg(this.id)" href="javascript:switch_main('/wma/wma.do?acton=session&todo=admin&K=<c:out value="${UA.key}"/>')"><fmt:message bundle='${common}' key='menu.mail' /></a></li>
				</c:if>

				<!--//QDB
				<c:if test="${UA.manager or UA.formAdmin}">
					<li><a href="javascript:switch_main('/qdb/form.do?K=<c:out value="${UA.key}"/>')"><fmt:message bundle='${common}' key='menu.admin.qdb' /></a></li>
				</c:if>
				-->

				</ul>
				<!-- //administrator user menu -->

				<!-- link menu -->
				<!-- TODO 1 : set 1 to bUseMenuLink in intranet_SYSTEM.ini -->
				<!-- TODO 2 : set attribute to href in Anchor
					- popup : javascript:popup_link('url', 'popup name', width_size, height_size)
							  EX> <li><a href="javascript:popup_link('url', 'popup name', width_size, height_size)">MENU NAME</a></li>
					- start frame : javascript:switch_main('url')
					          EX> <li><a href="javascript:switch_main('url')">MENU NAME</a></li>
				-->
				<c:if test="${INI_BUSEMENULINK eq '1'}">
				<ul id="link_menu" class="menu link" style="display: none;">
					<li class="menu_more" onclick="switch_menu('link_menu')" title="<fmt:message bundle='${common}' key='menu_close' />"><span class="arr_fd"></span></li>
					<li><a href="javascript:popup_link('_blank', 'name', 400, 400)">LINK1</a></li>
					<li><a href="javascript:popup_link('_blank', 'name', 400, 400)">LINK2</a></li>
					<li><a href="javascript:popup_link('_blank', 'name', 400, 400)">LINK3</a></li>
					<li><a href="javascript:popup_link('_blank', 'name', 400, 400)">LINK4</a></li>
					<li><a href="javascript:popup_link('_blank', 'name', 400, 400)">LINK5</a></li>
					<li><a href="javascript:popup_link('_blank', 'name', 400, 400)">LINK6</a></li>
				</ul>
				</c:if>
				<!-- //link menu -->

				<!-- //menu navigation -->

				<!--div class="menu_link"><a href="javascript:switch_main('/jsp/org/view/OrgFrame.jsp?K=<c:out value="${UA.key}"/>')"><fmt:message bundle='${common}' key='menu_organization' /></a></div-->
					
				<div class="menu_right">
					<div class="menu_link">
					<c:if test="${INI_BUSEMENULINK eq '1'}">
						<a href="javascript:switch_menu('link_menu')">LINK</a>
					</c:if>
					<c:if test="${UA.manager
									or UA.GLAdmin
									or UA.BBSAdmin
									or UA.orgSancAdmin
									or UA.nameCardAdmin
									or UA.formAdmin
									or UA.resAdmin
									or UA.infoAdmin
									or UA.COPAdmin
									or UA.deptManager
									or (UA.munAdmin and INI_BIZUNITUSE eq 1) }">
						<a href="javascript:switch_menu('admin_menu')"><fmt:message bundle='${common}' key='menu_administrator' /></a>
					</c:if>
					</div>
					<!-- my info -->
					<div class="owner_info">
						<span><c:out value="${UA.deptName}" /></span>
					<c:choose>
						<c:when test="${not empty OTHER_OFFICERS}">
							<span>
								<SELECT ID="other_officers" name="AdditionalOfficer" onChange="javascript:changeAdditionalUser(this.options[this.selectedIndex].value);">
								<c:forEach var="user" items="${OTHER_OFFICERS}" varStatus="status">
									<OPTION value='<c:out value="${user['ID']}"/>'>
										<c:out value="${user['NAME']}" />
										<c:if test="${status.index ne 0}">
											(<c:out value="${user['DEPTNAMEU']}" />)
										</c:if>
									</OPTION>
								</c:forEach>
								</SELECT>
							</span>
						</c:when>
						<c:otherwise>
							<span><c:out value="${UA.userName}" />  (<c:out value="${UA.userInfoMap['POSNAME']}" />)</span>
						</c:otherwise>
					</c:choose>
					</div>
					<!-- //my info -->
					<ul class="gnb">
						<li><a href="javascript:switch_main('/jsp/setting/MainFrame.jsp?K=<c:out value="${UA.key}"/>');clear_menu_bg();" class="config" title="<fmt:message bundle='${common}' key='menu_config' />"><span class="text"><fmt:message bundle='${common}' key='menu_config' /></span><span class="image"><img src="/img/main/btn_config.gif"></span></a></li>
						<li><a href="javascript:logout()" class="logout" title="<fmt:message bundle='${common}' key='menu_logout' />"><span class="text"><fmt:message bundle='${common}' key='menu_logout' /></span><span class="image"><img src="/img/main/btn_logout.gif"></span></a></li>
					</ul>
				</div>
			</div>
			<!-- //nav_bar -->
		</div>
		<!-- //header -->
	</div>
	<!-- //Handy GW 8.0 Wrapper -->
<!-- organization -->
<input type="hidden" id="startDept" value="" />
<input type="hidden" id="baseDept" value="<c:out value="${UA.deptID}"/>" />
<!-- //organization -->
<c:if test="${INI_BNOTUSEACTIVEXCONTROLLER ne '1'}">
    <OBJECT width=0 height=0 STYLE='display:block' ID="HDNotifyBiz" CLASSID="CLSID:5D96BE9C-0687-4195-8E97-13E81202DCB2" codebase="/HDNotifyBiz.cab#version=1,0,0,1"></OBJECT>
</c:if>
</body>
</html>